package com.springboot.ww.platform.pd.lms.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2024-07-18 18:16
 */
@NoArgsConstructor
@Data
public class PddCatAttrDTO {


    @JsonProperty("result")
    private ResultDTO result;
    @JsonProperty("success")
    private Boolean success;
    @JsonProperty("requestId")
    private String requestId;
    @JsonProperty("errorCode")
    private Integer errorCode;
    @JsonProperty("errorMsg")
    private String errorMsg;

    @NoArgsConstructor
    @Data
    public static class ResultDTO {
        @JsonProperty("inputMaxSpecNum")
        private Integer inputMaxSpecNum;
        @JsonProperty("chooseAllQualifySpec")
        private Boolean chooseAllQualifySpec;
        @JsonProperty("singleSpecValueNum")
        private Integer singleSpecValueNum;
        @JsonProperty("properties")
        private List<PropertiesDTO> properties;

        @NoArgsConstructor
        @Data
        public static class PropertiesDTO {
            @JsonProperty("templatePropertyValueParentList")
            private List<TemplatePropertyValue> templatePropertyValueParentList;
            @JsonProperty("numberInputTitle")
            private Object numberInputTitle;
            @JsonProperty("values")
            private List<ValuesDTO> values;
            @JsonProperty("valueUnit")
            private List<String> valueUnit;
            @JsonProperty("pid")
            private Long pid;
            @JsonProperty("templatePid")
            private Long templatePid;
            @JsonProperty("required")
            private Boolean required;
            @JsonProperty("inputMaxNum")
            private Integer inputMaxNum;
            @JsonProperty("minValue")
            private String minValue;
            @JsonProperty("propertyValueType")
            private Integer propertyValueType;
            @JsonProperty("feature")
            private Integer feature;
            @JsonProperty("valueRule")
            private Integer valueRule;
            @JsonProperty("propertyChooseTitle")
            private Object propertyChooseTitle;
            @JsonProperty("showType")
            private Integer showType;
            @JsonProperty("parentTemplatePid")
            private Long parentTemplatePid;
            @JsonProperty("mainSale")
            private Object mainSale;
            @JsonProperty("parentSpecId")
            private Long parentSpecId;
            @JsonProperty("maxValue")
            private String maxValue;
            @JsonProperty("chooseMaxNum")
            private Integer chooseMaxNum;
            @JsonProperty("valuePrecision")
            private Integer valuePrecision;
            @JsonProperty("controlType")
            private Integer controlType;
            @JsonProperty("name")
            private String name;
            @JsonProperty("isSale")
            private Boolean isSale;
            @JsonProperty("refPid")
            private Long refPid;
            @JsonProperty("id")
            private Long id;
            @JsonProperty("oldName")
            private String oldName;


            @NoArgsConstructor
            @Data
            public static class TemplatePropertyValue {
                @JsonProperty("parentVidList")
                private List<Long> parentVidList;
                @JsonProperty("vidList")
                private List<Long> vidList;
            }

            @NoArgsConstructor
            @Data
            public static class ValuesDTO {
                @JsonProperty("vid")
                private Long vid;
                @JsonProperty("specId")
                private Long specId;
                @JsonProperty("parentVidList")
                private Object parentVidList;
                @JsonProperty("extendInfo")
                private String extendInfo;
                @JsonProperty("value")
                private String value;
                @JsonProperty("group")
                private GroupDTO group;
            }
            @NoArgsConstructor
            @Data
            public static class GroupDTO {
                @JsonProperty("id")
                private String id;
                @JsonProperty("name")
                private String name;
            }

        }
    }
}
